//
//  TrackDotTableViewCell.m
//  location
//
//  Created by Dongxiang Xu on 2024/9/4.
//

#import "TrackDotTableViewCell.h"

@interface TrackDotTableViewCell ()

@property (nonatomic, strong) UILabel *title;
@property (nonatomic, strong) UILabel *subTitle;

@end

@implementation TrackDotTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _title = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, SCREEN_WIDTH-60, 20)];
        _title.font = DEFAULT_FONT(12);
        _title.textColor = BlackColor;
        [self.contentView addSubview:_title];
        
        _subTitle = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(_title.frame), SCREEN_WIDTH-60, 20)];
        _subTitle.font = DEFAULT_FONT(12);
        _subTitle.textColor = BlackColor;
        [self.contentView addSubview:_subTitle];
    }
    return self;
}


- (void)loadWithInfo:(NSDictionary *)info
{
    _title.text = [NSString stringWithFormat:@"%@（%@,%@）",[info[@"create_time"] substringWithRange:NSMakeRange(11, 8)],info[@"longtitude"],info[@"latitude"]];
    _subTitle.text = [NSString stringWithFormat:@"速度:%.0f 状态:%@ 原始状态:%@",[info[@"speed"] floatValue],info[@"activity"],info[@"org_activity"]];    
}

@end
